#include "SDL.h"
#include "SDL_ttf.h" 
#include <string>

using namespace std;

class Button
{
    private:
				SDL_Surface *screen;
                SDL_Rect button_rect;
                Uint32 button_color;
                string title;
    public:
                Button(){};
                Button(SDL_Surface* screen, int pos_x, int pos_y, int width, int height, Uint32 button_color, string title);

                void setPosition( int pos_x, int pos_y);
                void setSize( int width, int height);
                void setColor( Uint32 button_color);
                void setTitle( string title);
				bool handleEvent(SDL_Event* ev);
                //Returns true if the button was clicked
                //Receives the coordinates of the clicked pixel
                bool wasClicked(int pos_x, int pos_y);

                void draw();

                //It's necessary if the buttons draw from outside the class
                SDL_Rect* getID(){
                    return &button_rect;
                }

                ~Button(){};
};
